#!/usr/bin/env python

from gnuradio import gr, gr_unittest
import packet
import blocks_swig as blocks

class qa_qam_snr_estimator (gr_unittest.TestCase):

    def setUp (self):
        self.tb = gr.top_block ()

    def tearDown (self):
        self.tb = None

    def test_001_t (self):
        const = [1+1j, 1-1j, -1+1j, -1-1j]

        src_data = [1+1.5j]*30
        src = gr.vector_source_c (src_data)
        snr = blocks.qam_snr_estimator(20, 30, const)
        self.tb.connect (src, snr)
        self.tb.run ()
        print snr.snr()

if __name__ == '__main__':
    gr_unittest.run(qa_qam_snr_estimator, "qa_qam_snr_estimator.xml")
